build(server): upgrade to Spring Boot 4 (Jackson 3, Framework 7)#20
Conversation
Platform upgrade prerequisite for the Spring AI 2.x MCP layer. Server module only; the engine stays Spring-free and Java 17, and its 419 tests + the 20 byte-identical sample queries are untouched. - spring-boot 3.4.1 -> 4.0.7, springdoc 2.7.0 -> 3.0.3 (Boot-4/Jackson-3 line) - spring-boot-starter-web -> spring-boot-starter-webmvc (deprecated rename) - @WebMvcTest moved to org.springframework.boot.webmvc.test.autoconfigure; add spring-boot-starter-webmvc-test - TestRestTemplate relocated to org.springframework.boot.resttestclient and no longer auto-configured: add the dependency + @AutoConfigureTestRestTemplate, plus spring-boot-restclient (Boot #48588, not pulled transitively) - HttpHeaders.containsKey() removed in Framework 7 -> containsHeader() - migrate test JSON parsing to Jackson 3 (tools.jackson.databind, asString()) so it no longer relies on a transitive Jackson 2 from springdoc - sync README/AGENTS server section to the live Spring Boot gateway (was stale 'no Spring yet / ServerPlaceholder' since the gateway landed) Non-reparent BOM strategy retained; Java baseline stays 17. All 52 server tests green (incl. the 4 RANDOM_PORT integration tests over real HTTP).
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@claude review this PR |
|
Claude finished @JinBa1's task in 1m 29s —— View job PR Review:
|
| File | asText() calls migrated |
Import migrated |
|---|---|---|
BudgetIntegrationTest |
3 ✓ | ✓ |
QueryApiIntegrationTest |
5 ✓ | ✓ |
UploadApiIntegrationTest |
5 ✓ | ✓ |
UploadLimitIntegrationTest |
1 ✓ | ✓ |
No missed asText() calls or stale com.fasterxml imports. Good.
Test files — TestRestTemplate relocation
@AutoConfigureTestRestTemplate is correctly added to all 4 RANDOM_PORT integration tests. The import path org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate is the right Boot 4 location.
One forward-looking note: Spring Boot 4 introduced RestTestClient as the preferred successor to TestRestTemplate (fluent API, no deprecated path). Keeping TestRestTemplate for this upgrade is a perfectly reasonable behaviour-preserving choice — but a follow-up migration to RestTestClient would avoid living on the legacy client indefinitely.
HttpHeaders API
containsKey("Retry-After") → containsHeader("Retry-After") in BudgetIntegrationTest:72 and UploadLimitIntegrationTest:69 — correct, this is the Framework 7 API replacement.
@WebMvcTest package
org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest → org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest in QueryControllerTest and TableControllerTest — correct.
Production code
No changes to server/src/main/java. This is expected: the production controllers use Spring MVC's message converters for Jackson serialisation (no direct Jackson imports needed in controller code), so Boot 4's bundled Jackson 3 is picked up transparently.
Documentation
AGENTS.md and README.md are correctly updated to reflect that the server module is now a working REST gateway rather than a skeleton. The tree entries are accurate.
Summary
No bugs, no security issues, no missing migrations spotted. The two items worth noting for follow-up:
- Trim pom.xml inline comments — issue numbers belong in git history, not XML. Minor.
RestTestClientmigration —TestRestTemplateworks, butRestTestClientis the Boot 4 idiomatic choice for a cleaner future.
Neither of these blocks the merge.
Upgrades the
servermodule from Spring Boot 3.4.1 to 4.0.7, the prerequisite for upcoming Spring AI 2.x MCP integration (which requires Boot 4). Scoped to theservermodule only — theenginemodule stays Spring-free and on Java 17, and its 419 tests plus the 20 byte-identical sample queries are untouched.Changes
spring-boot3.4.1 → 4.0.7;springdoc-openapi2.7.0 → 3.0.3 (the Boot-4 / Jackson-3 line).spring-boot-starter-web→spring-boot-starter-webmvc(deprecated rename in Boot 4).@WebMvcTestmoved toorg.springframework.boot.webmvc.test.autoconfigure; addedspring-boot-starter-webmvc-test.TestRestTemplaterelocated toorg.springframework.boot.resttestclientand no longer auto-configured under@SpringBootTest: added the dependency +@AutoConfigureTestRestTemplate, plusspring-boot-restclient(not pulled transitively, Boot #48588).HttpHeaders.containsKey()removed in Framework 7 →containsHeader().tools.jackson.databind,asString()) so it no longer relies on a transitive Jackson 2.README/AGENTSserver section to the live Spring Boot gateway.Notes
spring-boot-dependencies) is retained.Verification
mvn clean testgreen across both modules: engine 419 + server 52, 0 failures / 0 skips. The 4 RANDOM_PORT integration tests exercise a real embedded Tomcat 11 over HTTP and assert identical response bodies and status codes.